package com.wzz.seckillone.common;

import com.wzz.seckillone.pojo.User;
import com.wzz.seckillone.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @ProjectName: seckillOne
 * @Package: com.wzz.seckillone.common
 * @ClassName: Common
 * @Author: wzz
 * @Description: 公用方法
 * @Date: 2022/3/18 20:03
 * @Version: 1.0
 */
@Component
public class Common {

    @Autowired
    private  UserService userService;

    public User getUser(){
        return userService.getUserById((String)SecurityUtils.getSubject().getPrincipal());
    }
}
